﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Collections.Generic;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace ThienLoc
{
    public partial class NoiDung : System.Web.UI.Page
    {
        private static string madm;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["mod"] != null)
            {
                madm = Request.QueryString["mod"].ToString();
                LoadContent(madm);
            }
            
        }

        private void LoadContent(string mod)
        {
            string sql = "SELECT TOP 1 TenDM,NoiDung FROM tblTLContent WHERE MaDM = @MaDM";
            List<SqlParameter> arrParams = new List<SqlParameter>();
            arrParams.Add(SqlHelper.CreateParameterObject("@MaDM", SqlDbType.NVarChar, ParameterDirection.Input, mod));
            DataTable dt = SqlHelper.ExecuteDataTable(CommandType.Text, sql, arrParams);
            ltrBreadcrumb.Text = dt.Rows[0]["TenDM"].ToString();
            txtContent.Text = dt.Rows[0]["NoiDung"].ToString(); ;

        }
    }
}
